<?php

namespace XWAM\Controller;

/**
 * 过滤设置 控制器
 *
 * @since 1.0 <2017-3-24> SoChishun <14507247@qq.com> Added.
 */
class FilterSetting extends AppbaseController {

    // 2017-3-24
    public function edit() {
        $where = array('title' => 'FilterSetting-' . $title, 'conf_group' => 'FilterSetting');
        $mDict = new \XWAM\Model\UserDictModel();
        $data = $mDict->where($where)->find();
        if (!$data) {
            $mDict->add($where);
            $data = $mDict->where($where)->find();
        }
        if (!$data) {
            exit('数据库错误!');
        }
        $list = array(
            array('title'=>'登录失败','name'=>''),
            array('title'=>'注册数量','name'=>''),
            array('title'=>'找回密码','name'=>''),
            array('title'=>'重置密码失败','name'=>''),
            array('title'=>'发表主题','name'=>''),
            array('title'=>'发表评论','name'=>''),
            array('title'=>'回复帖子','name'=>''),
            array('title'=>'POST请求','name'=>''),
            array('title'=>'搜索次数','name'=>''),
            array('title'=>'404次数','name'=>''),
            array('title'=>'验证码错误','name'=>''),
        );
        $this->assign('data', $data);
        $this->assign('list', $list);
        $this->display();
    }

    public function editSave() {
        $mDict = new \XWAM\Model\SensitiveWordsModel();
        $result = $mDict->saveConf();
        $this->dialogJump($result['status'], $result['info']);
    }

}
